#define _CRT_SECURE_NO_WARNINGS 1
#include "queue.h"
void queue::push(int x)
{
	queuenode* tem = (queuenode*)malloc(sizeof(queuenode));
	assert(tem);
	tem->val = x;
	tem->next = nullptr;
	if (head == nullptr)
	{
		head = tem;
		tail = head;
	}
	else
	{
		tail->next = tem;
		tail = tem;
	}
}
void queue::pop()
{
	assert(head);
	queuenode* cur = head;
	head = head->next;
	free(cur);
	cur = nullptr;
}